
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>git 使用 · 《前端学习笔记》</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="XiaoChen">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-ancre-navigation/style/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../MiniApp/Atom 完美支持 WePY 小程序开发.html" />
    
    
    <link rel="prev" href="homebrew 使用.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        <li class="header">前言</li>
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Android</li>
        
        
    
        <li class="chapter " data-level="2.1" data-path="../Android/Android 多包名打包应用.html">
            
                <a href="../Android/Android 多包名打包应用.html">
            
                    
                    Android 多包名打包应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="../Android/Android UI美化之 shape的使用及其属性总结.html">
            
                <a href="../Android/Android UI美化之 shape的使用及其属性总结.html">
            
                    
                    Android UI美化之 shape的使用及其属性总结
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">ReactNative</li>
        
        
    
        <li class="chapter " data-level="3.1" data-path="../ReactNative/CodePush 热更新配置及使用.html">
            
                <a href="../ReactNative/CodePush 热更新配置及使用.html">
            
                    
                    CodePush 热更新配置及使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="../ReactNative/已有Android工程 集成React Native.html">
            
                <a href="../ReactNative/已有Android工程 集成React Native.html">
            
                    
                    已有Android工程 集成React Native
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Egret</li>
        
        
    
        <li class="chapter " data-level="4.1" data-path="../Egret/Egret 白鹭引擎参考资料.html">
            
                <a href="../Egret/Egret 白鹭引擎参考资料.html">
            
                    
                    Egret 白鹭引擎参考资料
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="../Egret/EGER PRO.html">
            
                <a href="../Egret/EGER PRO.html">
            
                    
                    EGER PRO
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="4.3" data-path="../Egret/Egret 寻路.html">
            
                <a href="../Egret/Egret 寻路.html">
            
                    
                    Egret 寻路
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">工具</li>
        
        
    
        <li class="chapter " data-level="5.1" data-path="homebrew 使用.html">
            
                <a href="homebrew 使用.html">
            
                    
                    homebrew 使用
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="5.2" data-path="git 使用.html">
            
                <a href="git 使用.html">
            
                    
                    git 使用
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">小程序</li>
        
        
    
        <li class="chapter " data-level="6.1" data-path="../MiniApp/Atom 完美支持 WePY 小程序开发.html">
            
                <a href="../MiniApp/Atom 完美支持 WePY 小程序开发.html">
            
                    
                    Atom 完美支持 WePY 小程序开发
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="../MiniApp/Atom 插件安装慢解决方案.html">
            
                <a href="../MiniApp/Atom 插件安装慢解决方案.html">
            
                    
                    Atom 插件安装慢解决方案
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">Vue</li>
        
        
    
        <li class="chapter " data-level="7.1" data-path="../Vue2/Web 前端环境搭建.html">
            
                <a href="../Vue2/Web 前端环境搭建.html">
            
                    
                    Web 前端环境搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="../Vue2/Vue 项目搭建.html">
            
                <a href="../Vue2/Vue 项目搭建.html">
            
                    
                    Vue 项目搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="../Vue2/初识 VueCli 3.html">
            
                <a href="../Vue2/初识 VueCli 3.html">
            
                    
                    初识 VueCli 3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.4" data-path="../Vue2/使用 VueCli 3.html">
            
                <a href="../Vue2/使用 VueCli 3.html">
            
                    
                    使用 VueCli 3
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.5" data-path="../Vue2/VueCli 3 项目配置.html">
            
                <a href="../Vue2/VueCli 3 项目配置.html">
            
                    
                    VueCli 3 项目配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="7.6" data-path="../Vue3/Vue3探索.html">
            
                <a href="../Vue3/Vue3探索.html">
            
                    
                    初识 Vue3
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">微前端</li>
        
        
    
        <li class="chapter " data-level="8.1" data-path="../MicroApp/qiankun/">
            
                <a href="../MicroApp/qiankun/">
            
                    
                    qiankun
            
                </a>
            

            
        </li>
    

    
        
        <li class="header">团队成长</li>
        
        
    
        <li class="chapter " data-level="9.1" data-path="../Team/Web前端开发规范.html">
            
                <a href="../Team/Web前端开发规范.html">
            
                    
                    开发规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.2" data-path="../Team/Web团队建设--npm私库搭建.html">
            
                <a href="../Team/Web团队建设--npm私库搭建.html">
            
                    
                    私库搭建
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="9.3" data-path="../Team/Web团队建设--自定义脚手架.html">
            
                <a href="../Team/Web团队建设--自定义脚手架.html">
            
                    
                    脚手架搭建
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >git 使用</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <div id="anchor-navigation-ex-navbar"><i class="fa fa-anchor"></i><ul><li><span class="title-icon "></span><a href="#git&#x5E38;&#x7528;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;"><b></b>Git&#x5E38;&#x7528;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;</a></li></ul></div><a href="#git&#x5E38;&#x7528;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;" id="anchorNavigationExGoTop"><i class="fa fa-arrow-up"></i></a><h1 id="git&#x5E38;&#x7528;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;"><a name="git&#x5E38;&#x7528;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;" class="anchor-navigation-ex-anchor" href="#git&#x5E38;&#x7528;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;"><i class="fa fa-link" aria-hidden="true"></i></a>Git&#x5E38;&#x7528;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;</h1>
<ul>
<li>&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#x76F8;&#x5173;&#x547D;&#x4EE4;<ul>
<li>&#x68C0;&#x51FA;&#x4ED3;&#x5E93;&#xFF1A;$ git clone git://github.com/jquery/jquery.git</li>
<li>&#x67E5;&#x770B;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#xFF1A;$ git remote -v</li>
<li>&#x6DFB;&#x52A0;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#xFF1A;$ git remote add [name] [url]</li>
<li>&#x5220;&#x9664;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#xFF1A;$ git remote rm [name]</li>
<li>&#x4FEE;&#x6539;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#xFF1A;$ git remote set-url --push [name] [newUrl]</li>
<li>&#x62C9;&#x53D6;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#xFF1A;$ git pull [remoteName] [localBranchName]</li>
<li>&#x63A8;&#x9001;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#xFF1A;$ git push [remoteName] [localBranchName]</li>
</ul>
</li>
</ul>
<blockquote>
<p>&#x5982;&#x679C;&#x60F3;&#x628A;&#x672C;&#x5730;&#x7684;&#x67D0;&#x4E2A;&#x5206;&#x652F;test&#x63D0;&#x4EA4;&#x5230;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#xFF0C;&#x5E76;&#x4F5C;&#x4E3A;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#x7684;master&#x5206;&#x652F;&#xFF0C;&#x6216;&#x8005;&#x4F5C;&#x4E3A;&#x53E6;&#x5916;&#x4E00;&#x4E2A;&#x540D;&#x53EB;test&#x7684;&#x5206;&#x652F;&#xFF0C;&#x5982;&#x4E0B;&#xFF1A;<br>
$git push origin test:master // &#x63D0;&#x4EA4;&#x672C;&#x5730;test&#x5206;&#x652F;&#x4F5C;&#x4E3A;&#x8FDC;&#x7A0B;&#x7684;master&#x5206;&#x652F;<br>
$git push origin test:test // &#x63D0;&#x4EA4;&#x672C;&#x5730;test&#x5206;&#x652F;&#x4F5C;&#x4E3A;&#x8FDC;&#x7A0B;&#x7684;test&#x5206;&#x652F;</p>
</blockquote>
<ul>
<li>&#x5206;&#x652F;(branch)&#x64CD;&#x4F5C;&#x76F8;&#x5173;&#x547D;&#x4EE4;<ul>
<li>&#x67E5;&#x770B;&#x672C;&#x5730;&#x5206;&#x652F;&#xFF1A;$ git branch</li>
<li>&#x67E5;&#x770B;&#x8FDC;&#x7A0B;&#x5206;&#x652F;&#xFF1A;$ git branch -r</li>
<li>&#x62C9;&#x53D6;&#x8FDC;&#x7A0B;&#x5206;&#x652F;&#xFF1A;$ git fetch origin  [name]</li>
<li>&#x521B;&#x5EFA;&#x672C;&#x5730;&#x5206;&#x652F;&#xFF1A;$ git branch [name] ----&#x6CE8;&#x610F;&#x65B0;&#x5206;&#x652F;&#x521B;&#x5EFA;&#x540E;&#x4E0D;&#x4F1A;&#x81EA;&#x52A8;&#x5207;&#x6362;&#x4E3A;&#x5F53;&#x524D;&#x5206;&#x652F;</li>
<li>&#x5207;&#x6362;&#x5206;&#x652F;&#xFF1A;$ git checkout [name]</li>
<li>&#x521B;&#x5EFA;&#x65B0;&#x5206;&#x652F;&#x5E76;&#x7ACB;&#x5373;&#x5207;&#x6362;&#x5230;&#x65B0;&#x5206;&#x652F;&#xFF1A;$ git checkout -b [name]</li>
<li>&#x5220;&#x9664;&#x5206;&#x652F;&#xFF1A;$ git branch -d [name] ---- -d&#x9009;&#x9879;&#x53EA;&#x80FD;&#x5220;&#x9664;&#x5DF2;&#x7ECF;&#x53C2;&#x4E0E;&#x4E86;&#x5408;&#x5E76;&#x7684;&#x5206;&#x652F;&#xFF0C;&#x5BF9;&#x4E8E;&#x672A;&#x6709;&#x5408;&#x5E76;&#x7684;&#x5206;&#x652F;&#x662F;&#x65E0;&#x6CD5;&#x5220;&#x9664;&#x7684;&#x3002;&#x5982;&#x679C;&#x60F3;&#x5F3A;&#x5236;&#x5220;&#x9664;&#x4E00;&#x4E2A;&#x5206;&#x652F;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;-D&#x9009;&#x9879;</li>
<li>&#x5408;&#x5E76;&#x5206;&#x652F;&#xFF1A;$ git merge [name] ----&#x5C06;&#x540D;&#x79F0;&#x4E3A;[name]&#x7684;&#x5206;&#x652F;&#x4E0E;&#x5F53;&#x524D;&#x5206;&#x652F;&#x5408;&#x5E76;</li>
<li>&#x521B;&#x5EFA;&#x8FDC;&#x7A0B;&#x5206;&#x652F;(&#x672C;&#x5730;&#x5206;&#x652F;push&#x5230;&#x8FDC;&#x7A0B;)&#xFF1A;$ git push origin [name]</li>
<li>&#x5220;&#x9664;&#x8FDC;&#x7A0B;&#x5206;&#x652F;&#xFF1A;$ git push origin :heads/[name] &#x6216; $ git push origin :[name]</li>
</ul>
</li>
</ul>
<blockquote>
<p>&#x521B;&#x5EFA;&#x7A7A;&#x7684;&#x5206;&#x652F;&#xFF1A;(&#x6267;&#x884C;&#x547D;&#x4EE4;&#x4E4B;&#x524D;&#x8BB0;&#x5F97;&#x5148;&#x63D0;&#x4EA4;&#x4F60;&#x5F53;&#x524D;&#x5206;&#x652F;&#x7684;&#x4FEE;&#x6539;&#xFF0C;&#x5426;&#x5219;&#x4F1A;&#x88AB;&#x5F3A;&#x5236;&#x5220;&#x5E72;&#x51C0;&#x6CA1;&#x5F97;&#x540E;&#x6094;) <br>
$git symbolic-ref HEAD refs/heads/[name]<br>
$rm .git/index<br>
$git clean -fdx</p>
</blockquote>
<ul>
<li>git fetch</li>
<li>git checkout -b local-branchname origin/remote_branchname</li>
<li>&#x7248;&#x672C;(tag)&#x64CD;&#x4F5C;&#x76F8;&#x5173;&#x547D;&#x4EE4;<ul>
<li>&#x67E5;&#x770B;&#x7248;&#x672C;&#xFF1A;$ git tag</li>
<li>&#x521B;&#x5EFA;&#x7248;&#x672C;&#xFF1A;$ git tag [name]</li>
<li>&#x5220;&#x9664;&#x7248;&#x672C;&#xFF1A;$ git tag -d [name]</li>
<li>&#x67E5;&#x770B;&#x8FDC;&#x7A0B;&#x7248;&#x672C;&#xFF1A;$ git tag -r</li>
<li>&#x521B;&#x5EFA;&#x8FDC;&#x7A0B;&#x7248;&#x672C;(&#x672C;&#x5730;&#x7248;&#x672C;push&#x5230;&#x8FDC;&#x7A0B;)&#xFF1A;$ git push origin [name]</li>
<li>&#x5220;&#x9664;&#x8FDC;&#x7A0B;&#x7248;&#x672C;&#xFF1A;$ git push origin :refs/tags/[name]</li>
<li>&#x5408;&#x5E76;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#x7684;tag&#x5230;&#x672C;&#x5730;&#xFF1A;$ git pull origin --tags</li>
<li>&#x4E0A;&#x4F20;&#x672C;&#x5730;tag&#x5230;&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#xFF1A;$ git push origin --tags</li>
<li>&#x521B;&#x5EFA;&#x5E26;&#x6CE8;&#x91CA;&#x7684;tag&#xFF1A;$ git tag -a [name] -m &apos;yourMessage&apos;</li>
</ul>
</li>
<li><p>&#x5B50;&#x6A21;&#x5757;(submodule)&#x76F8;&#x5173;&#x64CD;&#x4F5C;&#x547D;&#x4EE4;</p>
<ul>
<li>&#x6DFB;&#x52A0;&#x5B50;&#x6A21;&#x5757;&#xFF1A;$ git submodule add [url] [path]</li>
<li>&#x5982;&#xFF1A;$git submodule add git://github.com/soberh/ui-libs.git src/main/webapp/ui-libs</li>
<li>&#x521D;&#x59CB;&#x5316;&#x5B50;&#x6A21;&#x5757;&#xFF1A;$ git submodule init ----&#x53EA;&#x5728;&#x9996;&#x6B21;&#x68C0;&#x51FA;&#x4ED3;&#x5E93;&#x65F6;&#x8FD0;&#x884C;&#x4E00;&#x6B21;&#x5C31;&#x884C;</li>
<li>&#x66F4;&#x65B0;&#x5B50;&#x6A21;&#x5757;&#xFF1A;$ git submodule update ----&#x6BCF;&#x6B21;&#x66F4;&#x65B0;&#x6216;&#x5207;&#x6362;&#x5206;&#x652F;&#x540E;&#x90FD;&#x9700;&#x8981;&#x8FD0;&#x884C;&#x4E00;&#x4E0B;</li>
<li>&#x5220;&#x9664;&#x5B50;&#x6A21;&#x5757;&#xFF1A;&#xFF08;&#x5206;4&#x6B65;&#x8D70;&#x54E6;&#xFF09;</li>
</ul>
</li>
<li><p>$ git rm --cached [path]</p>
</li>
<li>&#x7F16;&#x8F91;&#x201C;.gitmodules&#x201D;&#x6587;&#x4EF6;&#xFF0C;&#x5C06;&#x5B50;&#x6A21;&#x5757;&#x7684;&#x76F8;&#x5173;&#x914D;&#x7F6E;&#x8282;&#x70B9;&#x5220;&#x9664;&#x6389;</li>
<li>&#x7F16;&#x8F91;&#x201C; .git/config&#x201D;&#x6587;&#x4EF6;&#xFF0C;&#x5C06;&#x5B50;&#x6A21;&#x5757;&#x7684;&#x76F8;&#x5173;&#x914D;&#x7F6E;&#x8282;&#x70B9;&#x5220;&#x9664;&#x6389;</li>
<li><p>&#x624B;&#x52A8;&#x5220;&#x9664;&#x5B50;&#x6A21;&#x5757;&#x6B8B;&#x7559;&#x7684;&#x76EE;&#x5F55;</p>
</li>
<li><p>&#x5FFD;&#x7565;&#x4E00;&#x4E9B;&#x6587;&#x4EF6;&#x3001;&#x6587;&#x4EF6;&#x5939;&#x4E0D;&#x63D0;&#x4EA4;
&#x5728;&#x4ED3;&#x5E93;&#x6839;&#x76EE;&#x5F55;&#x4E0B;&#x521B;&#x5EFA;&#x540D;&#x79F0;&#x4E3A;&#x201C;.gitignore&#x201D;&#x7684;&#x6587;&#x4EF6;&#xFF0C;&#x5199;&#x5165;&#x4E0D;&#x9700;&#x8981;&#x7684;&#x6587;&#x4EF6;&#x5939;&#x540D;&#x6216;&#x6587;&#x4EF6;&#xFF0C;&#x6BCF;&#x4E2A;&#x5143;&#x7D20;&#x5360;&#x4E00;&#x884C;&#x5373;&#x53EF;&#xFF0C;&#x5982;
target
bin
*.db</p>
</li>
</ul>
<p>=====================</p>
<p>Git &#x5E38;&#x7528;&#x547D;&#x4EE4;</p>
<ul>
<li>git branch &#x67E5;&#x770B;&#x672C;&#x5730;&#x6240;&#x6709;&#x5206;&#x652F;</li>
<li>git status &#x67E5;&#x770B;&#x5F53;&#x524D;&#x72B6;&#x6001;</li>
<li>git commit &#x63D0;&#x4EA4;</li>
<li>git branch -a &#x67E5;&#x770B;&#x6240;&#x6709;&#x7684;&#x5206;&#x652F;</li>
<li>git branch -r &#x67E5;&#x770B;&#x672C;&#x5730;&#x6240;&#x6709;&#x5206;&#x652F;</li>
<li>git commit -am &quot;init&quot; &#x63D0;&#x4EA4;&#x5E76;&#x4E14;&#x52A0;&#x6CE8;&#x91CA;</li>
<li>git remote add origin git@192.168.1.119:ndshow</li>
<li>git push origin master &#x5C06;&#x6587;&#x4EF6;&#x7ED9;&#x63A8;&#x5230;&#x670D;&#x52A1;&#x5668;&#x4E0A;</li>
<li>git remote show origin &#x663E;&#x793A;&#x8FDC;&#x7A0B;&#x5E93;origin&#x91CC;&#x7684;&#x8D44;&#x6E90;</li>
<li>git push origin master:develop</li>
<li>git push origin master:hb-dev &#x5C06;&#x672C;&#x5730;&#x5E93;&#x4E0E;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x7684;&#x5E93;&#x8FDB;&#x884C;&#x5173;&#x8054;</li>
<li>git checkout --track origin/dev &#x5207;&#x6362;&#x5230;&#x8FDC;&#x7A0B;dev&#x5206;&#x652F;</li>
<li>git branch -D master develop &#x5220;&#x9664;&#x672C;&#x5730;&#x5E93;develop</li>
<li>git checkout -b dev &#x5EFA;&#x7ACB;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x672C;&#x5730;&#x5206;&#x652F;dev</li>
<li>git merge origin/dev &#x5C06;&#x5206;&#x652F;dev&#x4E0E;&#x5F53;&#x524D;&#x5206;&#x652F;&#x8FDB;&#x884C;&#x5408;&#x5E76;</li>
<li>git checkout dev &#x5207;&#x6362;&#x5230;&#x672C;&#x5730;dev&#x5206;&#x652F;</li>
<li>git remote show &#x67E5;&#x770B;&#x8FDC;&#x7A0B;&#x5E93;</li>
<li>git add .</li>
<li>git rm &#x6587;&#x4EF6;&#x540D;(&#x5305;&#x62EC;&#x8DEF;&#x5F84;) &#x4ECE;git&#x4E2D;&#x5220;&#x9664;&#x6307;&#x5B9A;&#x6587;&#x4EF6;</li>
<li>git clone git://github.com/schacon/grit.git &#x4ECE;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x5C06;&#x4EE3;&#x7801;&#x7ED9;&#x62C9;&#x4E0B;&#x6765;</li>
<li>git config --list &#x770B;&#x6240;&#x6709;&#x7528;&#x6237;</li>
<li>git ls-files &#x770B;&#x5DF2;&#x7ECF;&#x88AB;&#x63D0;&#x4EA4;&#x7684;</li>
<li>git rm [file name] &#x5220;&#x9664;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;</li>
<li>git commit -a &#x63D0;&#x4EA4;&#x5F53;&#x524D;repos&#x7684;&#x6240;&#x6709;&#x7684;&#x6539;&#x53D8;</li>
<li>git add [file name] &#x6DFB;&#x52A0;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x5230;git index</li>
<li>git commit -v &#x5F53;&#x4F60;&#x7528;&#xFF0D;v&#x53C2;&#x6570;&#x7684;&#x65F6;&#x5019;&#x53EF;&#x4EE5;&#x770B;commit&#x7684;&#x5DEE;&#x5F02;</li>
<li>git commit -m &quot;This is the message describing the commit&quot; &#x6DFB;&#x52A0;commit&#x4FE1;&#x606F;</li>
<li>git commit -a -a&#x662F;&#x4EE3;&#x8868;add&#xFF0C;&#x628A;&#x6240;&#x6709;&#x7684;change&#x52A0;&#x5230;git index&#x91CC;&#x7136;&#x540E;&#x518D;commit</li>
<li>git commit -a -v &#x4E00;&#x822C;&#x63D0;&#x4EA4;&#x547D;&#x4EE4;</li>
<li>git log &#x770B;&#x4F60;commit&#x7684;&#x65E5;&#x5FD7;</li>
<li>git diff &#x67E5;&#x770B;&#x5C1A;&#x672A;&#x6682;&#x5B58;&#x7684;&#x66F4;&#x65B0;</li>
<li>git rm a.a &#x79FB;&#x9664;&#x6587;&#x4EF6;(&#x4ECE;&#x6682;&#x5B58;&#x533A;&#x548C;&#x5DE5;&#x4F5C;&#x533A;&#x4E2D;&#x5220;&#x9664;)</li>
<li>git rm --cached a.a &#x79FB;&#x9664;&#x6587;&#x4EF6;(&#x53EA;&#x4ECE;&#x6682;&#x5B58;&#x533A;&#x4E2D;&#x5220;&#x9664;)</li>
<li>git commit -m &quot;remove&quot; &#x79FB;&#x9664;&#x6587;&#x4EF6;(&#x4ECE;Git&#x4E2D;&#x5220;&#x9664;)</li>
<li>git rm -f a.a &#x5F3A;&#x884C;&#x79FB;&#x9664;&#x4FEE;&#x6539;&#x540E;&#x6587;&#x4EF6;(&#x4ECE;&#x6682;&#x5B58;&#x533A;&#x548C;&#x5DE5;&#x4F5C;&#x533A;&#x4E2D;&#x5220;&#x9664;)</li>
<li>git diff --cached &#x6216; $ git diff --staged &#x67E5;&#x770B;&#x5C1A;&#x672A;&#x63D0;&#x4EA4;&#x7684;&#x66F4;&#x65B0;</li>
<li>git stash push &#x5C06;&#x6587;&#x4EF6;&#x7ED9;push&#x5230;&#x4E00;&#x4E2A;&#x4E34;&#x65F6;&#x7A7A;&#x95F4;&#x4E2D;</li>
<li>git stash pop &#x5C06;&#x6587;&#x4EF6;&#x4ECE;&#x4E34;&#x65F6;&#x7A7A;&#x95F4;pop&#x4E0B;&#x6765;</li>
</ul>
<hr>
<ul>
<li>git remote add origin git@github.com:username/Hello-World.git</li>
<li>git push origin master &#x5C06;&#x672C;&#x5730;&#x9879;&#x76EE;&#x7ED9;&#x63D0;&#x4EA4;&#x5230;&#x670D;&#x52A1;&#x5668;&#x4E2D;</li>
</ul>
<hr>
<ul>
<li>git pull &#x672C;&#x5730;&#x4E0E;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x540C;&#x6B65;</li>
</ul>
<hr>
<ul>
<li>git push (&#x8FDC;&#x7A0B;&#x4ED3;&#x5E93;&#x540D;) (&#x5206;&#x652F;&#x540D;) &#x5C06;&#x672C;&#x5730;&#x5206;&#x652F;&#x63A8;&#x9001;&#x5230;&#x670D;&#x52A1;&#x5668;&#x4E0A;&#x53BB;&#x3002;</li>
<li>git push origin serverfix:awesomebranch</li>
</ul>
<hr>
<ul>
<li>git fetch &#x76F8;&#x5F53;&#x4E8E;&#x662F;&#x4ECE;&#x8FDC;&#x7A0B;&#x83B7;&#x53D6;&#x6700;&#x65B0;&#x7248;&#x672C;&#x5230;&#x672C;&#x5730;&#xFF0C;&#x4E0D;&#x4F1A;&#x81EA;&#x52A8;merge</li>
<li>git commit -a -m &quot;log_message&quot; (-a&#x662F;&#x63D0;&#x4EA4;&#x6240;&#x6709;&#x6539;&#x52A8;&#xFF0C;-m&#x662F;&#x52A0;&#x5165;log&#x4FE1;&#x606F;) &#x672C;&#x5730;&#x4FEE;&#x6539;&#x540C;&#x6B65;&#x81F3;&#x670D;&#x52A1;&#x5668;&#x7AEF; &#xFF1A;</li>
<li>git branch branch_0.1 master &#x4ECE;&#x4E3B;&#x5206;&#x652F;master&#x521B;&#x5EFA;branch_0.1&#x5206;&#x652F;</li>
<li>git branch -m branch_0.1 branch_1.0 &#x5C06;branch_0.1&#x91CD;&#x547D;&#x540D;&#x4E3A;branch_1.0</li>
<li>git checkout branch_1.0/master &#x5207;&#x6362;&#x5230;branch_1.0/master&#x5206;&#x652F;</li>
</ul>
<p>*&#x6765;&#x6E90;&#xFF1A;<a href="http://blog.csdn.net/dengsilinming/article/details/8000622" target="_blank">http://blog.csdn.net/dengsilinming/article/details/8000622</a> </p>
<footer class="page-footer"><span class="copyright">Copyright &amp; copy zengqing.top 2023 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x4EF6;&#x66F4;&#x65B0;&#x4E8E;&#xFF1A;
2023-03-25 21:29:00
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="homebrew 使用.html" class="navigation navigation-prev " aria-label="Previous page: homebrew 使用">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../MiniApp/Atom 完美支持 WePY 小程序开发.html" class="navigation navigation-next " aria-label="Next page: Atom 完美支持 WePY 小程序开发">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"git 使用","level":"5.2","depth":1,"next":{"title":"Atom 完美支持 WePY 小程序开发","level":"6.1","depth":1,"path":"MiniApp/Atom 完美支持 WePY 小程序开发.md","ref":"./MiniApp/Atom 完美支持 WePY 小程序开发.md","articles":[]},"previous":{"title":"homebrew 使用","level":"5.1","depth":1,"path":"Tools/homebrew 使用.md","ref":"./Tools/homebrew 使用.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","code","pageview-count","chapter-fold","expandable-chapters-small","tbfed-pagefooter","hide-element","ancre-navigation"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"Copyright & copy zengqing.top 2023","modify_label":"该文件更新于：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"code":{"copyButtons":true},"hide-element":{"elements":[".gitbook-link"]},"fontsettings":{"theme":"white","family":"sans","size":2},"highlight":{},"pageview-count":{},"ancre-navigation":{"showLevel":true,"associatedWithSummary":true,"mode":"float","printLog":false,"multipleH1":true,"float":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""},"pageTop":{"showLevelIcon":false,"level1Icon":"","level2Icon":"","level3Icon":""}},"expandable-chapters-small":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"expandable-chapters":{}},"theme":"default","author":"XiaoChen","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"《前端学习笔记》","language":"zh-hans","gitbook":"*","description":"个人学习笔记，记录学习过程中的点点滴滴"},"file":{"path":"Tools/git 使用.md","mtime":"2023-03-25T13:29:00.098Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2023-03-26T04:06:26.355Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-expandable-chapters-small/expandable-chapters-small.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-hide-element/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

